balanced brackets interview question